import request from '@/utils/request'

// 查询Banner列表
export function listBanner(query) {
  return request({
    url: '/system/banner/list',
    method: 'get',
    params: query
  })
}
// 分页查询Banner列表
export function listBannerPage(query) {
  return request({
    url: '/system/banner/pages',
    method: 'get',
    params: query
  })
}
// 查询Banner详细
export function getBanner(bannerId) {
  return request({
    url: '/system/banner/' + bannerId,
    method: 'get'
  })
}
// 上传banner文件
export function uploadBannerFile(data) {
  return request({
    url: '/common/upload',
    method: 'post',
    headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
    data: data
  })
}

// 新增Banner
export function addBanner(data) {
  return request({
    url: '/system/banner',
    method: 'post',
    data: data
  })
}

// 修改Banner
export function updateBanner(data) {
  return request({
    url: '/system/banner',
    method: 'put',
    data: data
  })
}

// 删除Banner
export function delBanner(bannerId) {
  return request({
    url: '/system/banner/' + bannerId,
    method: 'delete'
  })
}
